package org.zht.dormpro.dorm.mapper;

import org.apache.ibatis.annotations.*;
import org.zht.dormpro.auth.bean.PageBean;
import org.zht.dormpro.dorm.bean.MajorDTO;
import org.zht.dormpro.dorm.model.TbCollege;
import org.zht.dormpro.dorm.model.TbMajor;

import java.util.List;

public interface TbMajorMapper {
    @Delete({
        "delete from tb_major",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    int insertSelective(TbMajor record);

    @Select({
        "select",
        "id, maj_id, col_id, maj_name, maj_remark, maj_append, maj_status",
        "from tb_major",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("org.zht.dormpro.dorm.mapper.TbMajorMapper.BaseResultMap")
    TbMajor selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TbMajor record);

    List<TbMajor> getAllMajor(@Param("all") int all);

    List<MajorDTO> getAllMajorByCondition(PageBean pageBean);

    List<TbMajor> getMajorByCollegeId(String colId);
}